package edu.tjut.cs.web;

import java.math.BigDecimal;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import edu.tjut.cs.dao.OrderDao;
import edu.tjut.cs.domain.Order;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;

@RestController
public class OrderController {
	@Autowired
	private OrderDao orderDao;
	
	@ApiOperation(httpMethod="POST", notes="查询订单额超过xxx元的订单", value="第二个演示")
	@ApiImplicitParam(name="amount", value="订单额", paramType="body", dataType="BigDecimal")
	@PostMapping("/order")
	public List<Order> orderTest1(@RequestBody BigDecimal amount) {
		return orderDao.findByOrderTotalAmountGreaterThan(amount);
	}
}
